READLINK

Section: System Calls (2)
Index Return to Main Contents

BSD mandoc
BSD 4.2  

NAME

readlink - read value of a symbolic link  

SYNOPSIS

Fd #include <unistd.h> Ft int Fn readlink const char *path char *buf int bufsiz  

DESCRIPTION

Fn Readlink places the contents of the symbolic link Fa path in the buffer Fa buf , which has size Fa bufsiz . Readlink does not append a NUL character to Fa buf .  

RETURN VALUES

The call returns the count of characters placed in the buffer if it succeeds, or a -1 if an error occurs, placing the error code in the global variable errno  

ERRORS

Fn Readlink will fail if:

Bq Er ENOTDIR
A component of the path prefix is not a directory.
Bq Er ENAMETOOLONG
A component of a pathname exceeded {NAME_MAX} characters, or an entire path name exceeded {PATH_MAX} characters.
Bq Er ENOENT
The named file does not exist.
Bq Er EACCES
Search permission is denied for a component of the path prefix.
Bq Er ELOOP
Too many symbolic links were encountered in translating the pathname.
Bq Er EINVAL
The named file is not a symbolic link.
Bq Er EIO
An I/O error occurred while reading from the file system.
Bq Er EFAULT
Fa Buf extends outside the process's allocated address space.

 

SEE ALSO

stat(2), lstat(2), symlink(2) symlink(7),  

HISTORY

The Fn readlink function call appeared in BSD 4.2


 

Index

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUES
ERRORS
SEE ALSO
HISTORY

This document was created by man2html, using the manual pages.
Time: 16:28:59 GMT, April 18, 2022